/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.clemson.cs.hamptos.adventure;

/**
 * <p>Parser that handles the end of the game.</p>
 * @author Nicks
 */
public class EndParser implements AdventureParser {
    public EndParser(int num)
    {
        magicnumber = num;
    }
    
    private Integer magicnumber = 654321;
    
    @Override
    public AdventureCommand parse(String command, AdventureEngine e) throws NoSuchTargetException {
        String verb = "NO GO";
        if (magicnumber.toString().equals(command))
        {
            verb = "FLEE NOW";
            e.stopEvil();
        }
        return new AdventureCommand(verb);
    }
    
}
